-
Notifications
You must be signed in to change notification settings - Fork 83
Uses new apply function so we don't need kubectl #101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi @somtochiama. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@@ -49,7 +56,8 @@ func (console) Run(c *exec.Cmd) error { | |||
} | |||
|
|||
// Apply runs the kubectl apply with the provided manifest argument | |||
func (c *Client) Apply(ctx context.Context, namespace string, manifest string, validate bool, extraArgs ...string) error { | |||
func (c *Client) ApplyAlt(ctx context.Context, namespace string, manifest string, validate bool, | |||
extraArgs ...string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit we tend not to split these over lines, or if we do we split all the args, one per line
ErrOut: os.Stderr, | ||
} | ||
restClient := genericclioptions.NewConfigFlags(true).WithDeprecatedPasswordFlag() | ||
//f := util.NewFactory(restClient) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: remove this (I think it's just old code)
|
||
b := resource.NewBuilder(restClient) | ||
res := b.Unstructured().Stream(ioReader, "cm").Do() | ||
//infos = append(infos, namespaceObj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: remove if it's old code
} | ||
applyOpts := apply.NewApplyOptions(ioStreams) | ||
applyOpts.Namespace = namespace | ||
buildApplyOpts(applyOpts, infos, ioStreams) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if splitting this function out is worth it vs just inlining it?
@@ -49,7 +56,8 @@ func (console) Run(c *exec.Cmd) error { | |||
} | |||
|
|||
// Apply runs the kubectl apply with the provided manifest argument | |||
func (c *Client) Apply(ctx context.Context, namespace string, manifest string, validate bool, extraArgs ...string) error { | |||
func (c *Client) ApplyAlt(ctx context.Context, namespace string, manifest string, validate bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I think having two types might be clearer here - e.g. one ExecKubectl
and one called DirectApply
, that both implement the same interface. We can discuss in our GSoC sync :-)
/ok-to-test |
Thanks @somtochiama - looks great and this is a big win in terms of our kubectl dependency! /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: justinsb, SomtochiAma The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
No description provided.